﻿using UnityEngine;

namespace Core
{
    public abstract class GameObjectEntity : Entity, IGameObject
    {
        public GameObject gameObject { get; protected set; }
        public Transform transform { get; protected set; }

        public void Awake(GameObject go)
        {
            gameObject = go;
            transform = gameObject.transform;
        }

        public override void Dispose()
        {
            if (IsDisposed) return;
            base.Dispose();

            transform = null;
            Utils.Trans.Destroy(gameObject);
            gameObject = null;
        }
    }
}